From b9c1953c79688fc3f536b7927692309c9780b5da Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 6 Jan 2022 17:55:24 +0100 Subject: refactor: reuse PostMeta components on single articles/pages --- src/pages/sujet/[slug].tsx | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'src/pages/sujet/[slug].tsx') diff --git a/src/pages/sujet/[slug].tsx b/src/pages/sujet/[slug].tsx index 527d529..bcea544 100644 --- a/src/pages/sujet/[slug].tsx +++ b/src/pages/sujet/[slug].tsx @@ -5,13 +5,14 @@ import { NextPageWithLayout } from '@ts/types/app'; import { SubjectProps } from '@ts/types/taxonomies'; import { loadTranslation } from '@utils/helpers/i18n'; import { GetStaticPaths, GetStaticProps, GetStaticPropsContext } from 'next'; -import Image from 'next/image'; import { ParsedUrlQuery } from 'querystring'; import styles from '@styles/pages/Subject.module.scss'; import { getAllSubjectsSlug, getSubjectBySlug, } from '@services/graphql/queries'; +import PostHeader from '@components/PostHeader/PostHeader'; +import { ArticleMeta } from '@ts/types/articles'; const Subject: NextPageWithLayout = ({ subject }) => { const getPostsList = () => { @@ -22,29 +23,18 @@ const Subject: NextPageWithLayout = ({ subject }) => { )); }; + const meta: ArticleMeta = { + website: subject.officialWebsite, + }; + return (
-
-

- {subject.featuredImage && ( - - {subject.featuredImage.altText} - - )} - {subject.title} -

- {subject.officialWebsite && ( -
-
{t`Official website:`}
-
{subject.officialWebsite}
-
- )} -
-
+
{subject.posts.length > 0 && (
-- cgit v1.2.3